function dickson_charge_flow_extra
% This function uses node equations and kcl to find the charge vector of a 4-to-1 4-phase dickson converter.

clc;

% [in C3 C2 C1 out]
A1=[0 1 0 1 -1;1 0 1 0 1;-1 -1 0 0 0; 0 0 -1 -1 0]
NullA1_0=null(A1)
NullA1=NullA1_0(2:end-1,1:end)

A2=[0 0 1 1 0; 0 0 0 1 1; 0 1 0 0 0;1 0 0 0 0]  % new 1
NullA2_0=null(A2)
NullA2=NullA2_0(2:end-1,1:end)

A3=[0 1 1 0 0; 0 1 0 1 1; 0 0 1 -1 -1; 1 0 0 0 0];
NullA3_0=null(A3)
NullA3=NullA3_0(2:end-1,1:end)

%q_in=0
A4=[0 1 1 0 0; 0 0 1 0 1; 0 0 0 1 0; 1 0 0 0 0];    % new 2
NullA4_0=null(A4)
NullA4=NullA4_0(2:end-1,1:end)


B=null([NullA1 NullA2 NullA3 NullA4])
